<!DOCTYPE html>
<html class="x-admin-sm"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.2</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="/static/admin/x-admin/css/font.css">
    <link rel="stylesheet" href="/static/admin/x-admin/css/xadmin.css">
    <script th:src="@{/static/admin/x-admin/lib/layui/layui.js}" charset="utf-8"></script>
    <script type="text/javascript" th:src="@{/static/admin/x-admin/js/xadmin.js}"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<div class="x-nav">
          <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">演示</a>
            <a>
              <cite>导航元素</cite></a>
          </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <button class="layui-btn layui-btn layui-btn-xs" ><i class="layui-icon">&#xe642;</i><a th:href="@{/room/admin/list}">全部信息</a></button>
                    <button class="layui-btn layui-btn layui-btn-xs" ><i class="layui-icon">&#xe642;</i><a th:href="@{/room/admin/list(roomOrderState=-1)}">不可用</a></button>
                    <button class="layui-btn layui-btn layui-btn-xs" ><i class="layui-icon">&#xe642;</i><a th:href="@{/room/admin/list(roomOrderState=0)}">未被预订</a></button>
                    <button class="layui-btn layui-btn layui-btn-xs" ><i class="layui-icon">&#xe642;</i><a th:href="@{/room/admin/list(roomOrderState=1)}">已被预订</a></button>
                    <select>
                        <option></option>
                    </select>
                </div>
                <div class="layui-card-body ">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th>
                                <input type="checkbox" name=""  lay-skin="primary">
                            </th>
                            <th>ID</th>
                            <th>门牌号</th>
                            <th>楼层</th>
                            <th>订单状态</th>
                            <th>打扫状态</th>
                            <th>操作</th>
                        </thead>
                        <tbody>
                        <tr th:each="attr,stta:${pageInfo.list}">
                            <td>
                                <input type="checkbox" name=""  lay-skin="primary">
                            </td>
                            <td th:text="${stta.count}"></td>
                            <td th:text="${attr.doorPlate}"></td>
                            <td th:text="${attr.roomFloor}"></td>
                            <td th:if="${attr.roomOrderState==-1}"><button class="layui-btn layui-btn-xs">不可用</button></td>
                            <td th:if="${attr.roomOrderState==0}"><button class="layui-btn layui-btn-xs">未被预订</button></td>
                            <td th:if="${attr.roomOrderState==1}"><button class="layui-btn layui-btn-xs">已被预订</button></td>
                            <td th:if="${attr.roomCleanState==-1}"><button class="layui-btn layui-btn-xs">未打扫</button></td>
                            <td th:if="${attr.roomCleanState==0}"><button class="layui-btn layui-btn-xs">打扫中</button></td>
                            <td th:if="${attr.roomCleanState==1}"><button class="layui-btn layui-btn-xs">已打扫</button></td>
                            <td class="td-manage">
                                <a title="显示房间信息"  th:onclick="|openInfo(${attr.roomInfoId},${attr.roomId})|" href="javascript:;">
                                    <i class="layui-icon">&#xe642;</i>
                                </a>

                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body ">
                    <div>
                        当前第 [[${pageInfo.pageNum}]]页，共 [[${pageInfo.pages}]] 页， 共 [[${pageInfo.total}]] 条记录
                    </div>

                    <table class="layui-table layui-form">
                        <button class="layui-btn layui-btn-xs">
                            <a th:href="'/room/admin/list?pageNum=1'">首页</a>
                        </button>
                        <button class="layui-btn layui-btn-xs" th:if="${pageInfo.hasPreviousPage}">
                            <a th:href="'/room/admin/list?pageNum='+${pageInfo.prePage}">
                                <i class="ace-icon fa fa-angle-double-left"></i>
                            </a>
                        </button>
                        <!--遍历条数-->
                        <button class="layui-btn layui-btn-xs" th:each="nav:${pageInfo.navigatepageNums}">
                            <a th:href="'/room/admin/list?pageNum='+${nav}" th:text="${nav}" th:if="${nav != pageInfo.pageNum}"></a>
                            <span style="font-weight: bold;background: #6faed9;" th:if="${nav == pageInfo.pageNum}" th:text="${nav}" ></span>
                        </button>

                        <button class="layui-btn layui-btn-xs" th:if="${pageInfo.hasNextPage}">
                            <a th:href="'/room/admin/list?pageNum='+${pageInfo.nextPage}">
                                <i class="ace-icon fa fa-angle-double-right"></i>
                            </a>
                        </button>
                        <button class="layui-btn layui-btn-xs">
                            <a th:href="'/room/admin/list?pageNum='+${pageInfo.pages}">尾页</a>
                        </button>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    layui.use(['laydate','form'], function(){
        var laydate = layui.laydate;
        var form = layui.form;

        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });
    });

</script>
<script>var _hmt = _hmt || []; (function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();</script>
<script>
    function openInfo(roomInfoId,roomId) {
        let url='/room-info/getInfo?roomInfoId='+roomInfoId+'&roomId='+roomId
        xadmin.open('房间信息',url,400,400)
    }
</script>
</html>